feat: draggable bounds#990
Merged
Merged
Conversation
whoami-amrit
commented
Dec 19, 2025
Contributor
- fix: bound movement of draggable to screen
- chore: rm file from eslintignore
There was a problem hiding this comment.
Pull request overview
This PR refactors the DraggableWrapper component to use native bounds constraint from the react-draggable library instead of custom boundary checking logic. The changes improve the positioning system by using screen-absolute coordinates instead of parent-relative positioning, and delegate boundary enforcement to the library's built-in bounds prop.
Key Changes:
- Replaced controlled position state with
defaultPositionand nativeboundsprop for boundary constraints - Refactored position calculations to use screen coordinates instead of parent-relative offsets
- Removed deprecated
layoutFixDeltaparameter from the component API
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| src/Common/DraggableWrapper/types.ts | Removed deprecated layoutFixDelta property from DraggableWrapperProps interface |
| src/Common/DraggableWrapper/DraggableWrapper.tsx | Refactored to use defaultPosition with bounds constraint, simplified position calculations for screen coordinates, and added visibility handling for initial render |
| .eslintignore | Removed DraggableWrapper.tsx from ESLint ignore list to enable linting |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
added 2 commits
December 22, 2025 14:38
AbhishekA1509
previously approved these changes
Dec 23, 2025
vivek-devtron
previously approved these changes
Dec 24, 2025
vikramdevtron
approved these changes
Dec 26, 2025
arunjaindev
approved these changes
Dec 26, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.